import Mock from "mockjs"
// 引入模拟的数据
import navList from './mockServeData/navigation/navigation.json'
import baseData from './mockServeData/home/base.json'
import chartsData from './mockServeData/home/charts.json'
import userApi from './mockServeData/user'
import permissionApi from './mockServeData/permission'

// 拦截请求：请求导航栏数据列表
Mock.mock('/api/nav/navList',{
  code:200,
  data:navList
})

// 拦截请求：请求首页(home)中的基本数据(非图表数据)
Mock.mock('/api/home/baseData',{
  code:200,
  data:baseData
})

// 拦截请求：请求首页(home)中的基本数据(非图表数据)
Mock.mock('/api/home/chartsData',{
  code:200,
  data:chartsData
})


Mock.mock(/api\/user\/addUser/, 'post', userApi.createUser)
Mock.mock(/api\/user\/edit/, 'post', userApi.updateUser)

Mock.mock(/api\/user\/userList/, 'get', userApi.getUserList)
Mock.mock(/api\/user\/deleteUser/, 'post', userApi.deleteUser)

Mock.mock(/api\/permission\/getMenu/, 'post', permissionApi.getMenu)